// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{4c7b2836-062f-4058-b67f-72fe4c7521e0}")]
	#endregion

	#region Documentation
	//1 Pokalbegegnung
	/// Pokalbegegnung
	#endregion

	#endregion
	public class Pokalbegegnung: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 5);
			public const int Bemerkung_MemberIndex = Eco_FirstMember + 0;
			public const int Pokalrunde_MemberIndex = Eco_FirstMember + 1;
			public const int Pokalwettbewerb_MemberIndex = Eco_FirstMember + 2;
			public const int Saison_MemberIndex = Eco_FirstMember + 3;
			public const int Spiel_MemberIndex = Eco_FirstMember + 4;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalbegegnung.Eco_LoopbackIndices.Pokalrunde_MemberIndex), Id="{fb6c7a5a-6c8c-4076-98d3-7cd6bc21b5d1}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalbegegnungPokalrunde), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Pokalrunde Pokalrunde
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Pokalrunde) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalrunde_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Pokalrunde_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalbegegnung.Eco_LoopbackIndices.Pokalwettbewerb_MemberIndex), Id="{c1cbaddf-8b16-4b8b-a9c1-daee5b135a44}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalwettbewerbPokalbegegnung), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Pokalwettbewerb Pokalwettbewerb
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Pokalwettbewerb) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalwettbewerb_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Pokalwettbewerb_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalbegegnung.Eco_LoopbackIndices.Spiel_MemberIndex), Id="{d9a95952-5393-42a1-9b4e-19654eda72ab}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalbegegnungSpiel), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Spiel Spiel
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Spiel) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Pokalbegegnung.Eco_LoopbackIndices.Bemerkung_MemberIndex), Id="{fe34eafd-6116-4479-9c98-940786c8828a}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Bemerkung zur Pokalbegegnung
		/// Bemerkung zur Pokalbegegnung
		#endregion

		#endregion
		public string Bemerkung
		{
			get
			{
				#region MM_ECO_Generated
				return (string) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Bemerkung_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Bemerkung_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Pokalbegegnung.Eco_LoopbackIndices.Saison_MemberIndex), Id="{ef866f73-aef3-4020-9307-f99de61220e5}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalbegegnungSaison), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Saison Saison
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Saison) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Pokalbegegnung(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Pokalbegegnung(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
